Get to Know Our Way of R
GUI = Graphical User Interface
The choice is yours!
Ctrl + Enter: Run current line/selectionCtrl + Shift + Enter: Run entire scriptCtrl + L: Clear consoleTab: AutocompleteCtrl + ↑: Command history05:00 .RData can save objects from previous sessionCtrl + Shift + F10.RDataR-studio is using Projects already by default
.Rproj file in root directory05:00 {here} Package
The {here} package is up for rescue!
Artwork by @allison_horst
here::here() in your R console03:00 {here}Make sure you have the latest version of R installed. You can check the version by running:
Install the newest version of R from CRAN.
Check out {updateR} package to update R and all installed packages.
Make sure you have the latest version of RStudio installed. You can check the version by running:
You can download the newest version of RStudio from RStudio website.
Rtools is a collection of tools necessary for building R packages on Windows.
You can download Rtools from CRAN Rtools page.
You need version compatible with your R version. For R 4.5+, use Rtools 4.5 or later.
The {usethis} package is a collection of functions that help automate package and project setup tasks.
Install the package by running:
Go to SSoQE - pre-workshop setup and run the provided code chunk in your R console to install all required packages.
Getting all the necessary software installed, configured, and playing nicely together is honestly half the battle … Brace yourself for some pain
You will need a GitHub account.
It is super easy to create one, just go to GitHub.com and follow the instructions.
If you are using RStudio, you can use the built-in terminal (NOT Console).
Is Git already installed?
Check your version:
Download and install Git for Windows
Download and install Git for MacOS
Introduce yourself to Git 👋
❗Note to substitute your name and the email address❗
Use the same email address as the one you used for GitHub account.
We now need to make sure that RStudio can communicate with Git.
Confirm that git has your name and email by running:
If needed, set the name and email by running:
We now need to make sure that RStudio can communicate with Git.
You can check more details about it here and here.
Click Generate token and copy the token to a safe place.
Add the PAT to RStudio by running:
Other useful functions:
If everything fails, you can try to set up the PAT manually into your .Renviron file.
Simply run:
Add a line like this, but substitute your PAT:
The materials used in this presentation are further expanded in a greater detail in course Science Powered through Reproducibility, Openness, and Teamwork (SPRouT) taught at Charles University.
Ondřej Mottl Assistant Professor at Charles University
Head of the 🧑💻 Laboratory of Quantitative Ecology